import {increment, decrement, reset} from './actions/counter';
import store from './store';


//打印初始状态
console.info( store.getState() );

//每次state 更新时，打印日志
//subscribe() 返回一个函数注销监听器
let unsubscribe = store.subscribe( () => console.info( store.getState() ) );

store.dispatch(increment());
store.dispatch(decrement());
store.dispatch(reset());

unsubscribe();